<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Curso</title>
</h:head>
<body>
	<h:form id="formGeneral"
		rendered="#{cursoPeriodoGrupoBean.verificarSesion()}">

		<p:toolbar>
			<p:toolbarGroup align="right">
				<p:commandButton value="salir" action="#{sesionBean.cerrarSesion()}"
					icon="ui-icon-close" />
			</p:toolbarGroup>
		</p:toolbar>

		<div align="center">
			<h:panelGrid columns="2" styleClass="fondo"
				style="text-align:center;">
				<h:panelGroup style="display:block; text-align:left">
					<p:graphicImage value="/img/ui/images.jpg"
						style="height: 100px; width: 210px" />
				</h:panelGroup>

				<h:panelGroup style="display:block; text-align:right">
					<p:graphicImage value="/img/ui/izq.png"
						style="height: 100px; width: 608px" />
				</h:panelGroup>
			</h:panelGrid>
		</div>
		<p:panel style="width:100%;">
			<h:panelGrid columns="2" cellpadding="2" cellspacing="15"
				style="width:100%;">
				<h:form>
					<p:outputLabel
						value="#{cursoPeriodoGrupoBean.cpg.cursoperiodo.curso.nombreCurso}" />
					<br></br>
					<br></br>
					<p:outputLabel value="Profesor :  " />
					<p:outputLabel
						value="#{cursoPeriodoGrupoBean.profesor.persona.nombrePersona}" />
				</h:form>
				<h:form style="text-align:right;">

				</h:form>
			</h:panelGrid>
		</p:panel>
		<p:panel style="width:100%;">
			<p:tabView id="formPestañas" effect="fade" effectDuration="normal">

				<p:tab title="Descripcion">
					<h:panelGrid columns="2" cellpadding="10">
						<h:outputText
							value="En matemÃ¡ticas, lÃ³gica, ciencias de la computaciÃ³n y disciplinas relacionadas, un algoritmo (del griego " />
					</h:panelGrid>

				</p:tab>

				<p:tab title="Alumnos">
					<h:panelGrid columns="2" cellpadding="10">
						<h:form id="form_a">
							<p:growl id="growlAlumn" showDetail="true" />
							<p:dataTable id="alum_table" var="matriculas"
								value="#{cursoPeriodoGrupoBean.matriculas}"
								selection="#{cursoPeriodoGrupoBean.matriculaSelected}"
								selectionMode="single" rowKey="#{matriculas.idMatricula}"
								sortMode="multiple">
								<p:ajax event="rowSelect"
									listener="#{cursoPeriodoGrupoBean.onRowSelectMatricula}"
									update=":#{p:component('displayMat')}"
									oncomplete="matDialog.show()" />
								<p:ajax event="rowUnselect"
									listener="#{cursoPeriodoGrupoBean.onRowUnselectMatricula}" />
								<p:column sortBy="#{matriculas.alumno.persona.apPaternoPersona}"
									headerText="Alumno">
									<h:outputText
										value="#{matriculas.alumno.persona.apPaternoPersona} "></h:outputText>
									<h:outputText
										value="#{matriculas.alumno.persona.apMaternoPersona} "></h:outputText>
									<h:outputText
										value="#{matriculas.alumno.persona.nombrePersona}"></h:outputText>
								</p:column>
							</p:dataTable>

							<p:dialog id="dialogAlum" header="Alumno Detalle"
								widgetVar="matDialog" resizable="false" showEffect="fade"
								hideEffect="explode">

								<h:panelGrid id="displayMat" columns="2" cellpadding="4">
									<h:outputText value="Codigo: " />
									<h:outputText
										value="#{cursoPeriodoGrupoBean.matriculaSelected.alumno.persona.usuarioPersona}" />
									<h:outputText value="Nombre: " />
									<h:outputText
										value="#{cursoPeriodoGrupoBean.matriculaSelected.alumno.persona.apPaternoPersona} #{cursoPeriodoGrupoBean.matriculaSelected.alumno.persona.apMaternoPersona} #{cursoPeriodoGrupoBean.matriculaSelected.alumno.persona.nombrePersona}" />
									<h:outputText value="Examenes Rendidos: " />
									<h:outputText
										value="#{cursoPeriodoGrupoBean.matriculaSelected.alumno.examens.size()}" />
									<h:outputText value="Promedio: " />
									<h:outputText
										value="#{cursoPeriodoGrupoBean.matriculaSelected.nota}" />

									<h:panelGrid>
										<!-- <p:lineChart id="catNote"
										value="#{chartBean.categoryModelNotas}" legendPosition="e"
										title="Notas" minY="0" maxY="30" style="height:200px;margin-top:5px" />-->
									</h:panelGrid>
								</h:panelGrid>
							</p:dialog>
						</h:form>
					</h:panelGrid>
				</p:tab>

				<p:tab title="Configurar examen">
					<p:growl id="growlxx" showDetail="true" />
					<p:commandButton value="Comenzar" icon="ui-icon-extlink"
						actionListener="#{cursoPeriodoGrupoBean.iniciarConfiguracion}">
						<p:ajax event="dialogReturn"
							listener="#{cursoPeriodoGrupoBean.onConfiguracionEscogida}"
							update="growlxx" />
					</p:commandButton>
				</p:tab>

				<p:tab title="Subir Preguntas">
					<p:growl id="growlPre" showDetail="true" />
					<p:commandButton value="Iniciar carga de preguntas"
						icon="ui-icon-extlink"
						actionListener="#{cursoPeriodoGrupoBean.subirPreguntas}">
						<p:ajax event="dialogReturn"
							listener="#{cursoPeriodoGrupoBean.onPreguntaEscogida}"
							update="growlPre" />
					</p:commandButton>
				</p:tab>


				<p:tab title="Estadisticas">
					<h:panelGrid columns="2" cellpadding="10">
						<h:outputText
							value="After a break of more than 15 years, director Francis Ford Coppola and writer Mario Puzo returned to the well for this third and final story of the fictional Corleone crime family.   
                    Two decades have passed, and crime kingpin Michael Corleone, now divorced from his wife Kay has nearly succeeded in keeping his promise that his family would one day be completely legitimate."></h:outputText>
					</h:panelGrid>
				</p:tab>

			</p:tabView>
		</p:panel>

	</h:form>
</body>
</html>
